package com.niuwa.p2p.dao.business;
import java.math.BigDecimal;
import java.util.List;
import java.util.Map;

import com.niuwa.p2p.dao.MyBatisDao;
import com.niuwa.p2p.entity.business.InvestProdRecord;
import com.niuwa.p2p.vo.front.account.CustomerinvestlogVo;
@MyBatisDao
public interface InvestProdRecordDao {
	int deleteByPrimaryKey(String recordNo);

	int insert(InvestProdRecord record);

	int insertSelective(InvestProdRecord record);

	InvestProdRecord selectByPrimaryKey(String recordNo);

	int updateByPrimaryKeySelectiveByVersion(InvestProdRecord record);

	int updateByPrimaryKeyByVersion(InvestProdRecord record);

	/**
	 * @Description: 根据条件获取投资记录
	 * by bwz at 2015年4月5日
	 * @param paramMap
	 * @return
	 */
	public List<InvestProdRecord> selectInvestRecordListPage(Map<String, Object> paramMap);

	/**
	 * @Description: 根据条件获取投资记录条数 
	 * by bwz at 2015年4月7日
	 * @param paramMap
	 * @return
	 */
	public int countProdRecord(Map<String, Object> paramMap);

	/**
	 * 投资人投资记录列表
	 * 
	 * @param param
	 * @return
	 */
	List<CustomerinvestlogVo> selectInvestListByCustIdListPage(Map<String, Object> param);

	/**
	 * 获取带匹配资金
	 * 
	 * @return
	 */
	BigDecimal getWaitMatchFund();

	Map<String, Object> selectInvestRecordByProNoCustId(Map<String, Object> mapParam);
	
	/**
	 * @description: 获取平台可用额度。
	 * @author liyijie
	 * @date 2015-04-21
	 * 
	 * @return
	 */
	public double getPlatformAmount4App();

	/**
	 * 查询days天后集合
	 * @param days
	 * @return
	 */
	List<InvestProdRecord> selectListByDays(Integer days);
	
	
	/**
	 * @Description: 查询客户是否购买过投资计划 
	 * add by bwz at 2015年4月30日
	 * @param custId
	 * @return
	 * @throws Exception
	 */
	public int countPlanProdRecord(Long custId) throws Exception;
}